import SetDefaultValue from "./SetDefaultValue";
import TYPES from "./actionType";
const INIT_STATE = new SetDefaultValue();

const newsDetail = (state = INIT_STATE, action) => {
    console.log('aaa',action.payload)
    const {type, payload} = action;
    switch(type) {
        case TYPES.SET_USER : {
            return {...state,user:{...state.user,...payload}}
        }
        case TYPES.SET_CATEGORY : {
            return {...state,category:{...state.cagegory,...payload}}
        }
        case TYPES.SET_CONTENT : {
            return {...state,content:{...state.content,...payload}}
        }
        case 'asnc-content': {
            return {...state,content:{...state.content,...payload}}
        }
        default:
            return state;
    }
}

export default newsDetail;